\(\int \frac {(d+e x+f x^2) (2-x-2 x^2+x^3)}{4-5 x^2+x^4} \, dx\) [69]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 36, antiderivative size = 31 \[ \int \frac {\left (d+e x+f x^2\right ) \left (2-x-2 x^2+x^3\right )}{4-5 x^2+x^4} \, dx=(e-4 f) x+\frac {1}{2} f (2+x)^2+(d-2 e+4 f) \log (2+x) \]

[Out]

(e-4*f)*x+1/2*f*(2+x)^2+(d-2*e+4*f)*ln(2+x)

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 31, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.056, Rules used = {1600, 712} \[ \int \frac {\left (d+e x+f x^2\right ) \left (2-x-2 x^2+x^3\right )}{4-5 x^2+x^4} \, dx=\log (x+2) (d-2 e+4 f)+x (e-4 f)+\frac {1}{2} f (x+2)^2 \]

[In]

Int[((d + e*x + f*x^2)*(2 - x - 2*x^2 + x^3))/(4 - 5*x^2 + x^4),x]

[Out]

(e - 4*f)*x + (f*(2 + x)^2)/2 + (d - 2*e + 4*f)*Log[2 + x]

Rule 712

Int[((d_.) + (e_.)*(x_))^(m_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(d +
 e*x)^m*(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*
e + a*e^2, 0] && NeQ[2*c*d - b*e, 0] && IntegerQ[p] && (GtQ[p, 0] || (EqQ[a, 0] && IntegerQ[m]))

Rule 1600

Int[(u_.)*(Px_)^(p_.)*(Qx_)^(q_.), x_Symbol] :> Int[u*PolynomialQuotient[Px, Qx, x]^p*Qx^(p + q), x] /; FreeQ[
q, x] && PolyQ[Px, x] && PolyQ[Qx, x] && EqQ[PolynomialRemainder[Px, Qx, x], 0] && IntegerQ[p] && LtQ[p*q, 0]

Rubi steps \begin{align*} \text {integral}& = \int \frac {d+e x+f x^2}{2+x} \, dx \\ & = \int \left (e-4 f+\frac {d-2 e+4 f}{2+x}+f (2+x)\right ) \, dx \\ & = (e-4 f) x+\frac {1}{2} f (2+x)^2+(d-2 e+4 f) \log (2+x) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 30, normalized size of antiderivative = 0.97 \[ \int \frac {\left (d+e x+f x^2\right ) \left (2-x-2 x^2+x^3\right )}{4-5 x^2+x^4} \, dx=\frac {1}{2} (2 e+f (-6+x)) (2+x)+(d-2 e+4 f) \log (2+x) \]

[In]

Integrate[((d + e*x + f*x^2)*(2 - x - 2*x^2 + x^3))/(4 - 5*x^2 + x^4),x]

[Out]

((2*e + f*(-6 + x))*(2 + x))/2 + (d - 2*e + 4*f)*Log[2 + x]

Maple [A] (verified)

Time = 0.03 (sec) , antiderivative size = 28, normalized size of antiderivative = 0.90

method result size
default \(\frac {f \,x^{2}}{2}+e x -2 f x +\left (d -2 e +4 f \right ) \ln \left (x +2\right )\) \(28\)
norman \(\left (e -2 f \right ) x +\frac {f \,x^{2}}{2}+\left (d -2 e +4 f \right ) \ln \left (x +2\right )\) \(28\)
risch \(\frac {f \,x^{2}}{2}+e x -2 f x +\ln \left (x +2\right ) d -2 \ln \left (x +2\right ) e +4 \ln \left (x +2\right ) f\) \(35\)
parallelrisch \(\frac {f \,x^{2}}{2}+e x -2 f x +\ln \left (x +2\right ) d -2 \ln \left (x +2\right ) e +4 \ln \left (x +2\right ) f\) \(35\)

[In]

int((f*x^2+e*x+d)*(x^3-2*x^2-x+2)/(x^4-5*x^2+4),x,method=_RETURNVERBOSE)

[Out]

1/2*f*x^2+e*x-2*f*x+(d-2*e+4*f)*ln(x+2)

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 27, normalized size of antiderivative = 0.87 \[ \int \frac {\left (d+e x+f x^2\right ) \left (2-x-2 x^2+x^3\right )}{4-5 x^2+x^4} \, dx=\frac {1}{2} \, f x^{2} + {\left (e - 2 \, f\right )} x + {\left (d - 2 \, e + 4 \, f\right )} \log \left (x + 2\right ) \]

[In]

integrate((f*x^2+e*x+d)*(x^3-2*x^2-x+2)/(x^4-5*x^2+4),x, algorithm="fricas")

[Out]

1/2*f*x^2 + (e - 2*f)*x + (d - 2*e + 4*f)*log(x + 2)

Sympy [A] (verification not implemented)

Time = 0.08 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.84 \[ \int \frac {\left (d+e x+f x^2\right ) \left (2-x-2 x^2+x^3\right )}{4-5 x^2+x^4} \, dx=\frac {f x^{2}}{2} + x \left (e - 2 f\right ) + \left (d - 2 e + 4 f\right ) \log {\left (x + 2 \right )} \]

[In]

integrate((f*x**2+e*x+d)*(x**3-2*x**2-x+2)/(x**4-5*x**2+4),x)

[Out]

f*x**2/2 + x*(e - 2*f) + (d - 2*e + 4*f)*log(x + 2)

Maxima [A] (verification not implemented)

none

Time = 0.18 (sec) , antiderivative size = 27, normalized size of antiderivative = 0.87 \[ \int \frac {\left (d+e x+f x^2\right ) \left (2-x-2 x^2+x^3\right )}{4-5 x^2+x^4} \, dx=\frac {1}{2} \, f x^{2} + {\left (e - 2 \, f\right )} x + {\left (d - 2 \, e + 4 \, f\right )} \log \left (x + 2\right ) \]

[In]

integrate((f*x^2+e*x+d)*(x^3-2*x^2-x+2)/(x^4-5*x^2+4),x, algorithm="maxima")

[Out]

1/2*f*x^2 + (e - 2*f)*x + (d - 2*e + 4*f)*log(x + 2)

Giac [A] (verification not implemented)

none

Time = 0.31 (sec) , antiderivative size = 28, normalized size of antiderivative = 0.90 \[ \int \frac {\left (d+e x+f x^2\right ) \left (2-x-2 x^2+x^3\right )}{4-5 x^2+x^4} \, dx=\frac {1}{2} \, f x^{2} + e x - 2 \, f x + {\left (d - 2 \, e + 4 \, f\right )} \log \left ({\left | x + 2 \right |}\right ) \]

[In]

integrate((f*x^2+e*x+d)*(x^3-2*x^2-x+2)/(x^4-5*x^2+4),x, algorithm="giac")

[Out]

1/2*f*x^2 + e*x - 2*f*x + (d - 2*e + 4*f)*log(abs(x + 2))

Mupad [B] (verification not implemented)

Time = 0.02 (sec) , antiderivative size = 27, normalized size of antiderivative = 0.87 \[ \int \frac {\left (d+e x+f x^2\right ) \left (2-x-2 x^2+x^3\right )}{4-5 x^2+x^4} \, dx=x\,\left (e-2\,f\right )+\frac {f\,x^2}{2}+\ln \left (x+2\right )\,\left (d-2\,e+4\,f\right ) \]

[In]

int(-((d + e*x + f*x^2)*(x + 2*x^2 - x^3 - 2))/(x^4 - 5*x^2 + 4),x)

[Out]

x*(e - 2*f) + (f*x^2)/2 + log(x + 2)*(d - 2*e + 4*f)